from operate import Operate
from ui import Ui
"""
冒烟测试通过 

需求凌乱：(需求如此
    返回值不统一
    随处打印信息
    
每次运行需要开户一次!!!!（需求如此

已添加友好提示！

"""
if __name__ == '__main__':
    Ui().enter()
    while 1:
        a = input("请输入你想要的操作：")
        if a == "1":
            ad = Operate().adduser()
            if ad == 1:
                print("开户成功")
            elif ad == 2:
                print("用户已存在")
            elif ad == 3:
                print("数据库已满")
            else:
                continue
        elif a == "2":
            if Operate().deposit() is False:
                print("没有该用户")
            else:
                print("存钱成功")
                continue
        elif a == "3":
            wd = Operate().withdrawal()
            if wd == 1:
                print("账户不存在")
            elif wd == 2:
                print("密码错误")
            elif wd == 3:
                print("余额不足")
            else:
                continue
        elif a == "4":
            tf = Operate().transfer()
            if tf == 1:
                print("账户不存在")
            elif tf == 2:
                print("密码错误")
            elif tf == 3:
                print("余额不足")
            else:
                continue
        elif a == "5":
            Operate().check()
            continue
        elif a == "6":
            break
        else:
            print("非法输入!")
    print("ByeBye!")